/**
 * 
 */
package com.easidea.tim.entity.inventory;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.springside.core.dao.extend.Undeletable;

import com.easidea.tim.entity.BaseEntity;
import com.easidea.tim.entity.commodity.Product;

/**
 * @author Harrison
 *
 */
@Entity(name="tim_inventory_storage_history")
@org.hibernate.annotations.Entity(dynamicInsert=true,dynamicUpdate=true)
@Undeletable(status = "deleted")
@Cache(region="tim_inventory_storage_history",usage=CacheConcurrencyStrategy.READ_WRITE)
public class StorageHistory extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7063779610063206309L;
	
	
	private Product product;
	private String productName;
	private String colorCode;
	private Boolean sampleFlag;
	private Integer piNum;
	private Double meterNum;

	/**
	 * @return the product
	 */
	@OneToOne(optional=true, fetch=FetchType.LAZY)
	@JoinColumn(name="product_id", nullable=false)
	public Product getProduct() {
		return product;
	}
	/**
	 * @param product the product to set
	 */
	public void setProduct(Product product) {
		this.product = product;
	}
	/**
	 * @return the pName
	 */
	@Column(name="p_name")
	public String getProductName() {
		return productName;
	}
	/**
	 * @param name the pName to set
	 */
	public void setProductName(String productName) {
		this.productName = productName;
	}
	/**
	 * @return the pColor
	 */
	@Column(name="p_color")
	public String getColorCode() {
		return colorCode;
	}
	/**
	 * @param color the pColor to set
	 */
	public void setColorCode(String colorCode) {
		this.colorCode = colorCode;
	}
	/**
	 * @return the sampleFlag
	 */
	@Column(name="sample_flag")
	public Boolean getSampleFlag() {
		return sampleFlag;
	}
	/**
	 * @param sampleFlag the sampleFlag to set
	 */
	public void setSampleFlag(Boolean sampleFlag) {
		this.sampleFlag = sampleFlag;
	}
	/**
	 * @return the piNum
	 */
	@Column(name="pi_num", nullable=false)
	public Integer getPiNum() {
		return piNum;
	}
	/**
	 * @param piNum the piNum to set
	 */
	public void setPiNum(Integer piNum) {
		this.piNum = piNum;
	}
	/**
	 * @return the meterNum
	 */
	@Column(name="meter_num",length=10,precision=2, nullable=false)
	public Double getMeterNum() {
		return meterNum;
	}
	/**
	 * @param meterNum the meterNum to set
	 */
	public void setMeterNum(Double meterNum) {
		this.meterNum = meterNum;
	}
}
